/** 
 * UserSymbolTable.java
 * @author Lex
 * 2007-8-23 ����04:36:56
 */
package fun.symtable;

import fun.parser.ast.AstParser;

public class UserSymbolTable {
	private static SymbolTable user = null;
	static {
		user = new DefaultSymbolTable("User");
		user.setParent(SystemSymbolTable.getInstance());
		// ================================================
		AstParser parser = new AstParser();
		try {
			parser.parse("f(x) = x * x - 5*x + 1").getValue(user);
			parser.parse("g = 9.8").getValue(user);
			parser.parse("h(x) = x * cos(x)");
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	private UserSymbolTable() {
	}

	public static SymbolTable getInstance() {
		return user;
	}
}
